package generator.controller;

import lombok.Data;

import java.io.Serializable;
@Data
public class JsonResult implements Serializable {

    private String code;
    private String msg;
    private Object data;

    public JsonResult(String number, String msg, Object o) {
        this.code = number;
        this.msg = msg;
        this.data = o;
    }

    public static JsonResult fail(String msg) {
        return new JsonResult("500", msg, null);
    }

    public static JsonResult fail(String msg, Object o) {
        return new JsonResult("500", null, o);
    }

    public static JsonResult success(String msg) {
        return new JsonResult("200", msg, null);
    }
}
